package com.lzh.template.model.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.lzh.template.common.BaseEntity;
import lombok.*;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 用户表(User)表实体类
 *
 * @author luzhiheng
 * @since 2022-09-26 16:46:58
 */
@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("sys_user")
@Builder
@Accessors(chain = true)
@Entity
@Table(name = "sys_user", indexes = {})
public class User extends BaseEntity {

    /**
     * 用户名
     */
    @Column(name = "user_name", columnDefinition = "varchar(255) COMMENT '用户名'")
    private String userName;

    /**
     * 昵称
     */
    @Column(name = "nick_name", columnDefinition = "varchar(255) COMMENT '昵称'")
    private String nickName;

    /**
     * 密码
     */
    @Column(name = "password", columnDefinition = "varchar(255) COMMENT '密码'")
    private String password;

    /**
     * 账号状态（0正常 1停用）
     */
    @Column(name = "status", columnDefinition = "int COMMENT '账号状态（0正常 1停用）'")
    private Integer status;

    /**
     * 邮箱
     */
    @Column(name = "email", columnDefinition = "varchar(255) COMMENT '邮箱'")
    private String email;

    /**
     * 地址
     */
    @Column(name = "address", columnDefinition = "varchar(255) COMMENT '地址'")
    private String address;

    /**
     * 手机号
     */
    @Column(name = "phone", columnDefinition = "varchar(255) COMMENT '手机号'")
    private String phone;

    /**
     * 用户性别（0男，1女，2未知）
     */
    @Column(name = "sex", columnDefinition = "int COMMENT '用户性别（0男，1女，2未知）'")
    private Integer sex;

    /**
     * 头像
     */
    @Column(name = "avatar", columnDefinition = "varchar(255) COMMENT '头像'")
    private String avatar;

    /**
     * 备注
     */
    @Column(name = "remark", columnDefinition = "varchar(255) COMMENT '备注'")
    private String remark;

    public User(Long userId, String avatar) {
        this.setId(userId);
        this.avatar = avatar;
    }
}

